import request from '/@/utils/request';
import * as config from './config'


//查询菜单列表
export const postMenus = (data) => request.post(config.menus, data)

export const postMenusByTree = (data) => request.post(config.treeMenuList, data)



//按照id查询
export const getMenu = (id) => request.get(config.menuURD + id)
export const addMenu= (data)=>request.post(config.menuURD,data)
export const editMenu = (data)=>request.put(config.menuURD+data.id,data)
export const deleteMenu = (ids)=>request.delete(config.menuURD+ids)

export const getMenuListByRoleId = (roleId) =>request.get(config.menuListByRoleId+roleId)


export const getRoutes = async () => {
    return request.get(config.routeList);
}

export const getRoute = (id) => request.get(config.routeURD + id)